package online.foxnull2.foxmall.ware.mapper;

import online.foxnull2.foxmall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author foxnull2
 */
@Mapper
public interface WareSkuMapper extends BaseMapper<WareSkuEntity> {

    Long hasStock(@Param("skuId") Long skuId);

    List<Long> listWareIdBySkuId(@Param("skuId") Long skuId);

    Integer lockSkuStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("count") Integer count);

    void stockRelease(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("count") Integer count);
}
